import { EntitySchema } from '@mikro-orm/core';

export class LeOrderEvaluate {
  id!: string;
  orderSn!: string;
  UID!: string;
  goodsName!: string;
  goodsImage!: string;
  goodsId!: string;
  goodsParamKey?: string;
  goodsParam?: string;
  status: boolean = true;
  star!: boolean;
  content!: string;
  images?: string;
  reply?: string;
  AppID!: string;
  merchantId!: string;
  createdTime?: number = 0;
  updatedTime?: number = 0;
  deletedTime?: number = 0;
  isDeleted?: number = 0;
  showGoodsParam?: string;
  aiAvatar!: string;
  aiNickname!: string;
  aiType: boolean = false;
}

export const LeOrderEvaluateSchema = new EntitySchema({
  class: LeOrderEvaluate,
  properties: {
    id: { primary: true, type: 'string', columnType: 'bigint' },
    orderSn: { type: 'string', length: 50, index: '订单编号' },
    UID: { type: 'string', fieldName: 'UID', columnType: 'bigint', index: '用户id' },
    goodsName: { type: 'string', length: 100 },
    goodsImage: { type: 'string', length: 255 },
    goodsId: { type: 'string', columnType: 'bigint', index: '商品id' },
    goodsParamKey: { type: 'string', length: 255, nullable: true },
    goodsParam: { type: 'string', length: 255, nullable: true },
    status: { type: 'boolean', default: true },
    star: { type: 'boolean' },
    content: { type: 'string', columnType: 'text' },
    images: { type: 'string', columnType: 'text', nullable: true },
    reply: { type: 'string', columnType: 'text', nullable: true },
    AppID: { type: 'string', fieldName: 'AppID', length: 50 },
    merchantId: { type: 'string', columnType: 'bigint' },
    createdTime: { type: 'number', nullable: true, default: 0 },
    updatedTime: { type: 'number', nullable: true, default: 0 },
    deletedTime: { type: 'number', nullable: true, default: 0 },
    isDeleted: { type: 'number', columnType: 'tinyint', nullable: true, default: 0 },
    showGoodsParam: { type: 'string', length: 255, nullable: true },
    aiAvatar: { type: 'string', length: 4096 },
    aiNickname: { type: 'string', length: 16 },
    aiType: { type: 'boolean', default: false },
  },
});
